ARG REDIS_VERSION
FROM redis:${REDIS_VERSION}-alpine

LABEL maintainer="zyw <1657776088@qq.com>"
USER root
RUN mkdir -p  /usr/local/etc/redis
RUN mkdir -p  /var/log/redis \ 
    && touch /var/log/redis/redis.log \
	&& chmod -R 777 /var/log/redis      
COPY ./conf/redis.conf /usr/local/etc/redis/redis.conf
#RUN sed -i s@/https://dl-cdn.alpinelinux.org/@/http://mirrors.aliyun.com/@g /etc/apk/repositories
#RUN apk update 
#RUN apk add  curl \
#    && rm -rf /var/lib/apk/lists/* \
#    && mkdir -p  /usr/local/etc/redis/ \ 
#    && curl http://download.redis.io/redis-stable/redis.conf > /usr/local/etc/redis/redis.conf
CMD [ "redis-server","/usr/local/etc/redis/redis.conf" ]
#CMD [ "redis-server"]

EXPOSE 6379